package cn.iocoder.yudao.module.system.dal.mysql.authrecorddatascopevalue;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.authrecorddatascopevalue.AuthRecordDataScopeValueDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.authrecorddatascopevalue.vo.*;

/**
 * 授权记录和权限范围值关系 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface AuthRecordDataScopeValueMapper extends BaseMapperX<AuthRecordDataScopeValueDO> {

    default PageResult<AuthRecordDataScopeValueDO> selectPage(AuthRecordDataScopeValuePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AuthRecordDataScopeValueDO>()
                .eqIfPresent(AuthRecordDataScopeValueDO::getUserRoleId, reqVO.getUserRoleId())
                .eqIfPresent(AuthRecordDataScopeValueDO::getDataScopeValueId, reqVO.getDataScopeValueId())
                .betweenIfPresent(AuthRecordDataScopeValueDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AuthRecordDataScopeValueDO::getId));
    }

}